package com.itheima.work1123;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class Demo04 {
    //字符输入流读取Demo03的文件
    public static void main(String[] args) throws IOException {
        //创建流对象
        FileReader red = new FileReader("poetry.txt");
        //读取数据
        char[] buf = new char[1024];
        int len;
        while ((len = red.read(buf))!=-1){
            System.out.print(new String(buf,0,len));
        }
        //释放资源
        red.close();
    }
}
